/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.nuboat.easyjsf.listener;

import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


/**
 *
 * @author nuboat
 */
public class AuthorizePhaseListener implements PhaseListener {

    private static final Log log = LogFactory.getLog(AuthorizePhaseListener.class);

    @Override
    public void afterPhase(PhaseEvent event) {
        FacesContext fc = event.getFacesContext();

    }

    @Override
    public void beforePhase(PhaseEvent event) {
        FacesContext fc = event.getFacesContext();
        String rootId = fc.getViewRoot().getViewId();

        log.info("rootviewid : " + rootId);
        
    }

    @Override
    public PhaseId getPhaseId() {
        return PhaseId.RENDER_RESPONSE;
    }



}
